<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>StreamSQL</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/StreamSQL"> <link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-StreamSQL rootpage-StreamSQL skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">StreamSQL</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><style data-mw-deduplicate="TemplateStyles:r1251242444">
/* start https://en.wikipedia.org/ */
.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style>
<p><b>StreamSQL</b> is a query language that extends <a href="SQL" title="SQL">SQL</a> with the ability to process real-time <a href="Data_stream" title="Data stream">data streams</a>. SQL is primarily intended for manipulating <a href="Relation_(database)" title="Relation (database)">relations</a> (also known as tables), which are finite <a href="Multiset" title="Multiset">bags</a> of <a href="Tuple" title="Tuple">tuples</a> (rows). StreamSQL adds the ability to manipulate streams, which are infinite sequences of tuples that are not all available at the same time. Because streams are infinite, operations over streams must be <a href="Monotonic" class="mw-redirect" title="Monotonic">monotonic</a>. Queries over streams are generally "continuous", executing for long periods of time and returning incremental results.
</p><p>The StreamSQL language is typically used in the context of a <a href="Data_Stream_Management_System" class="mw-redirect" title="Data Stream Management System">Data Stream Management System</a> (DSMS), for applications including market data analytics, <a href="Network_monitoring" title="Network monitoring">network monitoring</a>, surveillance, e-fraud detection and prevention, <a href="Clickstream" class="mw-redirect" title="Clickstream">clickstream</a> analytics and real-time compliance (<a href="Anti-money_laundering" class="mw-redirect" title="Anti-money laundering">anti-money laundering</a>, <a href="RegNMS" class="mw-redirect" title="RegNMS">RegNMS</a>, <a href="MiFID" class="mw-redirect" title="MiFID">MiFID</a>).
</p><p>Other streaming and continuous variants of SQL include <a rel="nofollow" class="external text" href="https://streamsql.io">StreamSQL.io</a>, <a rel="nofollow" class="external text" href="https://www.confluent.io/blog/ksql-open-source-streaming-sql-for-apache-kafka/">Kafka KSQL</a>, <a rel="nofollow" class="external text" href="https://eventador.io/blog/introducing-sqlstreambuilder/">SQLStreamBuilder</a>, <a rel="nofollow" class="external text" href="https://wso2.com/analytics">WSO2 Stream Processor</a>, <a rel="nofollow" class="external text" href="https://web.archive.org/web/20080218012118/http://www.sqlstream.com/">SQLStreams</a>, <a rel="nofollow" class="external text" href="https://ieeexplore.ieee.org/document/7530060/">SamzaSQL</a>, and <a rel="nofollow" class="external text" href="https://storm.apache.org/releases/2.1.0/storm-sql.html">Storm SQL</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Technical_details">Technical details</h2></div>
<p>StreamSQL extends the type system of SQL to support streams in addition to tables. Several new operations are introduced to manipulate streams.
</p><p><b>Selecting from a stream</b> -
A standard <code>SELECT</code> statement can be issued against a stream to calculate functions (using the target list) or filter out unwanted tuples (using a <code>WHERE</code> clause). The result will be a new stream.
</p><p><b>Stream-Relation Join</b> -
A stream can be joined with a relation to produce a new stream. Each tuple on the stream is joined with the current value of the relation based on a predicate to produce 0 or more tuples.
</p><p><b>Union and Merge</b> -
Two or more streams can be combined by unioning or merging them. Unioning combines tuples in strict <a href="FIFO_(computing_and_electronics)" title="FIFO (computing and electronics)">FIFO</a> order. Merging is more deterministic, combining streams according to a sort key.
</p><p><b>Windowing and Aggregation</b> -
A stream can be windowed to create finite sets of tuples. For example, a window of size 5 minutes would contain all the tuples in a given 5 minute period. Window definitions can allow complex selections of messages, based on tuple field values. Once a finite batch of tuples is created, analytics such as count, average, max, etc., can be applied.
</p><p><b>Windowing and Joining</b> -
A pair of streams can also be windowed and then joined together. Tuples within the join windows will combine to create resulting tuples if they fulfill the predicate.
</p>
<div class="mw-heading mw-heading2"><h2 id="History">History</h2></div>
<p>StreamSQL is derived from academic research into <a href="Event_Stream_Processing" class="mw-redirect" title="Event Stream Processing">Event Stream Processing</a>, closely related to <a href="Complex_event_processing" title="Complex event processing">complex event processing</a>.
Led by <a href="Michael_Stonebraker" title="Michael Stonebraker">Michael Stonebraker</a>, a team of 30 professors and students on project Aurora worked collaboratively from 2001 through 2003 to develop the core principles behind StreamSQL.
</p><p>The Aurora project was superseded by the <a rel="nofollow" class="external text" href="http://cs.brown.edu/research/borealis/public/">Borealis project</a>. Borealis is a distributed multi-processor version of Aurora.
</p></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2024-12-22" href="https://en.wikipedia.org/wiki/?title=StreamSQL&oldid=1264467450">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>